<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>虚线setLineDash  </title>
</head>
<body>
<canvas id="canvas" width="200" height="200"></canvas>
<script>
  var ctx = document.getElementById('canvas').getContext('2d');

  ctx.shadowOffsetX = 2;
  ctx.shadowOffsetY = 2;
  ctx.shadowBlur = 2;
  ctx.shadowColor = "rgba(0, 0, 0, 0.5)";

  ctx.font = "20px Times New Roman";
  ctx.fillStyle = "Black";
  ctx.fillText("Sample String", 5, 30);

</script>
</body>
</html>